# Maintainer: Krassy Boykinov <kboykinov@teamcentrixx.com>
pkgname=libdovi
pkgver=3.2.0
pkgrel=1
pkgdesc="Library to read & write Dolby Vision metadata"
url="https://github.com/quietvoid/dovi_tool"
arch="all"
license="MIT"
makedepends="
	cargo
	cargo-auditable
	cargo-c
	"
subpackages="$pkgname-dev"
source="https://github.com/quietvoid/dovi_tool/archive/refs/tags/libdovi-$pkgver.tar.gz"
builddir="$srcdir/dovi_tool-libdovi-$pkgver"
options="net" # cargo

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --manifest-path dolby_vision/Cargo.toml
}

build() {
	cargo auditable cbuild \
		--release \
		--frozen \
		--prefix /usr \
		--library-type cdylib \
		--manifest-path dolby_vision/Cargo.toml
}

check() {
	cargo test --frozen --manifest-path dolby_vision/Cargo.toml
}

package() {
	cargo auditable cinstall \
		--release \
		--frozen \
		--prefix /usr \
		--destdir "$pkgdir" \
		--library-type cdylib \
		--manifest-path dolby_vision/Cargo.toml
}

sha512sums="
9388a076e1396fb11aea4382eb9f28bf0ee4c0bc0ce9cc857a3ae138b8169c3d60657f128ee0261570d5de680af2b92dcde25442407a5c4580c51c2cce7ba47b  libdovi-3.2.0.tar.gz
"
